const mongoose = require('mongoose')
// 创建文档对象
let demo1schema = new mongoose.Schema({
  userid: {
    type: String,
    required: true,
  },
  name: {
    type: String,
    // unique: true,
    required: true,
    default: '梁伟俊',
    enum: ["梁伟俊", "梁伟杰", "林俊杰"]
  },

  address: {
    type: String,
    required: true,
  },
  phonenumber: {
    type: Number,
    required: true,
  },

})
// 创建文档模型
let model = mongoose.model('demo1', demo1schema)
// 插入文档
// model.create({
//   id: 16105230225,
//   name: "梁伟俊",
//   address: '高州',
//   phonenumber: "888",
// })
// 删除文档
// model.deleteMany({ name: '梁伟俊' })
module.exports = model